home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / Interfaces&Libraries / Interfaces / AIncludes / Signal.a < prev    next >
Encoding:
Text File  |  1996-05-07  |  1.7 KB  |  62 lines  |  [TEXT/MPS ]

  1. ;  File Signal.a
  2. ;
  3. ;  Copyright Apple Computer, Inc. 1986, 1990-1996
  4. ;  All rights reserved.
  5. ;
  6. ;  Include File for Signal processing in the MPW Environment
  7.  
  8. ;  Set CASE OBJECT to assure references to the names IMPORTed here link
  9. ;  properly.  The following statements restore the CASE setting to its
  10. ;  previous value.
  11.  
  12.     IF &TYPE('__IncludingSignal__') = 'UNDEFINED' THEN
  13. __IncludingSignal__    SET    1
  14.  
  15.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  16.     include 'ConditionalMacros.a'
  17.     ENDIF
  18.  
  19.     IF GENERATING68K THEN
  20.  
  21.             PRINT            Push,Off            ; save the current print settings and turn it off
  22.             GBLC            &S%%%%,&P%%%%
  23. &S%%%%        SETC            &Setting('CASE')    ; save the current CASE setting
  24. &P%%%%        SETC            &Setting('PRINT',1) ; and the PRINT settings before we changed them
  25.  
  26.             MACRO                
  27.             X%%%%
  28.             GBLC            &S%%%%,&P%%%%        ; link references with previously defined variables
  29.             PRINT            Push,&P%%%%         ; restore the previous PRINT settings
  30.             CASE            &S%%%%                ; and restore the CASE setting
  31.             PRINT            POP                 ; restore the PRINT settings
  32.             ENDM
  33.  
  34.             PRINT            Pop                 ; restore the PRINT settings
  35.             CASE            OBJECT                ; all imported/exported names case significant
  36.  
  37.  
  38. SIG_DFL        EQU             1
  39. SIG_ERR        EQU             -1
  40. SIG_IGN        EQU             0
  41. SIG_HOLD    EQU             3
  42. SIG_RELEASE    EQU             5
  43.  
  44. SIGABRT        EQU             $0001
  45. SIGINT        EQU             $0002
  46. SIGFPE        EQU             $0004
  47. SIGILL        EQU             $0008
  48. SIGSEGV        EQU             $0010
  49. SIGTERM        EQU             $0020
  50.  
  51.             IMPORT            signal
  52.             IMPORT            raise
  53.  
  54.             PRINT            Push,Off            ; save and turn off PRINT when macro is invoked
  55.             X%%%%                                ; invoke the macro to restore CASE setting
  56.             PRINT            POP                 ; restore the PRINT settings
  57.  
  58.     ELSE
  59.         aerror    'Signal.a is a 68K only assembly file!'
  60.     ENDIF    ; ...GENERATING68K
  61.     
  62.     ENDIF    ; ...already included